/*
 * Potion.cpp
 *
 *  Created on: Oct 19, 2011
 *	Created by: Devin Manno
 *  Updated by: Devin Manno
 *	Last Update: Oct 19, 2011
 */

#include "Potion.h"

// potion
// Randomly generates a potion that refills health, action
//	points, or both
// Pre: none
// Post: a new potion is created
// Returns: none (constructor)
Potion::Potion() : Base("Potion") {
	srand(time(NULL));
	int value = rand() % 7;
	switch (value) {
	case 0:
		setDesc("Minor Health Potion");
		hitPointPercentage = 0.25;
		actionPointPercentage = 0;
		break;
	case 1:
		setDesc("Medium Health Potion");
		hitPointPercentage = 0.5;
		actionPointPercentage = 0;
		break;
	case 2:
		setDesc("Strong Health Potion");
		hitPointPercentage = .75;
		actionPointPercentage = 0;
		break;
	case 3:
		setDesc("Minor Action Potion");
		hitPointPercentage = 0;
		actionPointPercentage = 0.25;
		break;
	case 4:
		setDesc("Medium Action Potion");
		hitPointPercentage = 0;
		actionPointPercentage = 0.5;
		break;
	case 5:
		setDesc("Strong Action Potion");
		hitPointPercentage = 0;
		actionPointPercentage = 0.75;
		break;
	case 6:
		setDesc("Fortification Potion");
		hitPointPercentage = 0.55;
		actionPointPercentage = 0.55;
		break;
	default: // shouldn't happen
		setDesc("Oddidy Potion");
		hitPointPercentage = 0;
		actionPointPercentage = 0;
		break;
	}

}

Potion::~Potion() {
	// TODO Auto-generated destructor stub
}

// getters
float Potion::getHitPointPercentage(){
	return hitPointPercentage;
}

float Potion::getActionPointPercentage(){
	return actionPointPercentage;
}
